﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using WindowsFormsApp1.学生;
using WindowsFormsApp1.管理员;
using 考试管理系统;

namespace WindowsFormsApp1
{
    public delegate void K(string name);
    public partial class Interchange : Form
    {
        public static K k;
      
        public Interchange(string name)
        {
            InitializeComponent();
            k = s;
            s(name);
        }
        public void s(string name)
        {
            Form form = null;
            switch (FrmLogin.UseName)
            {
                case "老师": form = new FmHome(); (form as FmHome).UseName = name; break;
                case "学生": form = new StudentInterface(); break;
                case "管理员": form = new Administrator(); break;
            }

            form.TopLevel = false;
            form.Parent = panel1;

            form.Show();
            if (panel1.Controls.Count > 1)
            {
                panel1.Controls.RemoveAt(0);
            }
          
        }
    }
}
